package com.googlecode.svnj;

public class NativeEditor implements IDeltaEditor {

    // native data structure
    
    private long ptr;
    private static final int DEBUG = 0;
    private NativeEditor(int type) {
        if (type == DEBUG) initDebug();
    }
    public static NativeEditor createDebug() {
        return new NativeEditor(DEBUG);
    }
    static {
        System.loadLibrary("svnj");
        initFields();
    }
    private static native void initFields();
    
    private native void initDebug();
    
    /*** IDeltaEditor interface ***/
    public native void abortEdit() throws Exception;
    
    public native void absentDirectory(String path) throws Exception;
    
    public native void absentFile(String path) throws Exception;
    
    public native void addDirectory(String path, String copyFromPath,
            long copyFromRevision) throws Exception;
    
    public native void addFile(String path, String copyFromPath, long copyFromRevision)
            throws Exception;
    
    public native void appendTextDelta(String deltaStr) throws Exception;
    
    public native void beginTextDelta(String baseChecksum) throws Exception;
    
    public native void changeDirProp(String name, String value) throws Exception;
    
    public native void changeFileProp(String name, String value) throws Exception;
    
    public native void closeDirectory() throws Exception;
    
    public native void closeEdit() throws Exception;
    
    public native void closeFile(String txtChecksum) throws Exception;
    
    public native void deleteEntry(String path, long revision) throws Exception;
    
    public native void endTextDelta() throws Exception;
    
    public native void openDirectory(String path, long baseRevision) throws Exception;
    
    public native void openFile(String path, long baseRevision) throws Exception;
    
    public native void openRoot(long revision) throws Exception;
    
    public native void setTargetRevision(long revision) throws Exception;

}
